<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
<h:head>
    <title>JEE Training - JSF Section</title>
</h:head>
<h:body>
    <h:outputText>Goodbye</h:outputText>

    <h:dataTable var="book" value="#{bookBean.listBooks}" id="listBooks">
        <h:column>
            <f:facet name="header">Book title</f:facet>
            #{book.title}
        </h:column>
    </h:dataTable>

    <h:form id="addBookForm">
        <h:inputText id="bookTitle" name="bookTitle" value="#{bookBean.bookTitle}"/>
        <h:commandButton actionListener="#{bookBean.saveBook}" value="Submit">
            <f:ajax execute="bookTitle" render=":listBooks"/>
        </h:commandButton>
    </h:form>
</h:body>
</html>